package com.jiali.backend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jiali.backend.common.ResponseResult;
import com.jiali.backend.controller.request.AppointmentRequest;
import com.jiali.backend.controller.request.OrderUpdateRequest;
import com.jiali.backend.model.AppointmentOrder;
import jakarta.servlet.http.HttpServletRequest;
import java.time.LocalDateTime;
import java.util.List;


/**
 * @author piko
 * @description 针对表【appointment_order(预约订单)】的数据库操作Service
 * @createDate 2025-03-20 19:20:42
 */
public interface AppointmentOrderService extends IService<AppointmentOrder> {

    ResponseResult<AppointmentOrder> createAppointment(AppointmentRequest request, HttpServletRequest httpRequest);
    //查询所有订单
    ResponseResult<List<AppointmentOrder>> getAllAppointments(HttpServletRequest httpRequest);
    //根据状态查询订单
    ResponseResult<List<AppointmentOrder>> getUserAppointmentsByStatus(HttpServletRequest httpRequest, Integer status);
    //订单状态更新
    ResponseResult<AppointmentOrder> updateAppointmentStatus(OrderUpdateRequest request, HttpServletRequest httpRequest);
    //删除订单
    ResponseResult<Boolean> deleteOrder(Integer orderId, HttpServletRequest request);
    // 用户取消订单
    ResponseResult<Boolean> cancelOrderByUser(Integer orderId, HttpServletRequest request);
    //高级搜索订单
    ResponseResult<List<AppointmentOrder>> searchOrders(
            Integer id,
            String model,
            String serviceName,
            LocalDateTime startDate,
            LocalDateTime endDate,
            Integer status,
            HttpServletRequest request);
}

